<?php
/**
 * bs系统
 * ============================================================================
 * 版权所有 2024-2099 wltx666.com，并保留所有权利。
 * 网站地址: https://wltx666.com
 * ============================================================================
 * Author: 草上飞
 * Email: wltx@alipay168.cn
 * QQ: 2719875001
 * Date: 2024/12/15
 * 描述:
 */

use think\facade\Route;

Route::get('/', 'app\admin\controller\Index@index');
Route::get('index', 'app\admin\controller\Index@dashboard'); // 后台入口




//上传相关
Route::group('upload', function () {
    Route::rule('file', 'app\admin\controller\Upload@file', 'POST');//图片上传
    Route::rule('image', 'app\admin\controller\Upload@image', 'POST');//图片上传
    Route::rule('chunk', 'app\admin\controller\Upload@chunk', 'POST');//文件分片上传
    Route::rule('upload_group', 'app\admin\controller\Upload@list_group', 'POST|GET|PUT|DELETE');
    Route::rule('index', 'app\admin\controller\Upload@list', 'POST|GET');
    Route::rule('list', 'app\admin\controller\Upload@list', 'POST|GET');
    Route::get('get', 'app\admin\controller\Upload@get');
    Route::delete('delete', 'app\admin\controller\Upload@del_data');
    Route::rule('ueditor', 'app\admin\controller\Upload@ueditor', 'POST|GET|DELETE|PUT');

});

Route::group('login', function () {
    Route::get('index', 'app\admin\controller\Login@index');
    Route::post('login', 'app\admin\controller\Login@login');
    Route::post('logout', 'app\admin\controller\Login@logout');
});
//功能管理
Route::group('features', function () {
    Route::get('index', 'app\admin\controller\Features@index');
    Route::get('list', 'app\admin\controller\Features@list');
    Route::get('list_config', 'app\admin\controller\Features@list_config');
    Route::rule('save', 'app\admin\controller\Features@save_data', 'POST|PUT');
    Route::delete('delete', 'app\admin\controller\Features@deldata');
});


//菜单管理
Route::group('menus', function () {
    Route::get('index', 'app\admin\controller\Menus@index');//落地页
    Route::get('my_list', "app\admin\controller\Menus@my_list");//我的菜单
    Route::get('list_config', "app\admin\controller\Menus@list_config");
    Route::get('list', "app\admin\controller\Menus@list");
    Route::get('get', "app\admin\controller\Menus@get");
    Route::rule('save', "app\admin\controller\Menus@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\Menus@del_data");
    Route::post('copy', "app\admin\controller\Menus@copy");
    Route::get('list_options', 'app\admin\controller\Menus@list_options');
});

//管理员管理
Route::group('admin', function () {
    Route::get('index', "app\admin\controller\Admin@index");
    Route::get('list', "app\admin\controller\Admin@list");
    Route::get('list_config', "app\admin\controller\Admin@list_config");
    Route::get('get', "app\admin\controller\Admin@get");
    Route::rule('save', "app\admin\controller\Admin@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\Admin@del_data");
    Route::put('status', 'app\admin\controller\Admin@status');
});

//角色管理
Route::group('role', function () {
    Route::get('index', "app\admin\controller\Role@index");
    Route::get('list', 'app\admin\controller\Role@list');
    Route::get('list_config', 'app\admin\controller\Role@list_config');
    Route::delete('delete', 'app\admin\controller\Role@deldata');
    Route::get('get', "app\admin\controller\Role@get");
    Route::rule('save', "app\admin\controller\Role@save_data", 'POST|PUT');
    Route::get('list_options', 'app\admin\controller\Role@list_options');
    Route::put('status', "app\admin\controller\Role@status");
    Route::get('set_auth', "app\admin\controller\Role@set_auth");
    Route::get('auths', "app\admin\controller\Role@auths");
    Route::post('auths_save', "app\admin\controller\Role@auths_save");
});

//curd
Route::group('curd', function () {
    Route::get('index', "app\admin\controller\Curd@index");
    Route::get('table_info', 'app\admin\controller\Curd@table_info');
    Route::post('save', 'app\admin\controller\Curd@save_data');
});

//备份
Route::group('backup', function () {
    Route::get('index', "app\admin\controller\Backup@index");
    Route::get('list_config', 'app\admin\controller\Backup@list_config');
    Route::get('list', 'app\admin\controller\Backup@list');
    Route::delete('delete', 'app\admin\controller\Backup@del_data');
    Route::post('save', 'app\admin\controller\Backup@save_data');
    Route::get('download', 'app\admin\controller\Backup@download');//下载
    Route::post('restore', 'app\admin\controller\Backup@restore');//还原
});


//管理员登录日志
Route::group('admin_login_log', function () {
    Route::get('list_config', "app\admin\controller\auto\AdminLoginLog@list_config");
    Route::get('index', "app\admin\controller\auto\AdminLoginLog@index");
    Route::get('list', "app\admin\controller\auto\AdminLoginLog@list");
    Route::get('get', "app\admin\controller\auto\AdminLoginLog@get");
    Route::get('list_options', "app\admin\controller\auto\AdminLoginLog@list_options");
});

//管理员操作日志
Route::group('admin_action_log', function () {
    Route::get('index', "app\admin\controller\auto\AdminActionLog@index");
    Route::get('list_config', "app\admin\controller\auto\AdminActionLog@list_config");
    Route::get('list', "app\admin\controller\auto\AdminActionLog@list");
    Route::delete('delete', "app\admin\controller\auto\AdminActionLog@del_data");
});

//文件上传日志
Route::group('upload_files_log', function () {
    Route::get('list_config', "app\admin\controller\auto\UploadFilesLog@list_config");
    Route::get('index', "app\admin\controller\auto\UploadFilesLog@index");
    Route::get('list', "app\admin\controller\auto\UploadFilesLog@list");
    Route::get('get', "app\admin\controller\auto\UploadFilesLog@get");
    Route::get('list_options', "app\admin\controller\auto\UploadFilesLog@list_options");
});

//项目
Route::group('project', function () {
    Route::get('index', "app\admin\controller\auto\Project@index");
    Route::get('list_config', "app\admin\controller\auto\Project@list_config");
    Route::get('list', "app\admin\controller\auto\Project@list");
    Route::rule('save', "app\admin\controller\auto\Project@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\auto\Project@del_data");
    Route::get('list_options', "app\admin\controller\auto\Project@list_options");
});

//我的笔记
Route::group('note_books', function () {
    Route::get('index', "app\admin\controller\auto\NoteBooks@index");
    Route::get('list_config', "app\admin\controller\auto\NoteBooks@list_config");
    Route::get('list', "app\admin\controller\auto\NoteBooks@list");
    Route::rule('save', "app\admin\controller\auto\NoteBooks@save_data", 'POST|PUT');
    Route::delete('delete', "app\admin\controller\auto\NoteBooks@del_data");
    Route::put('status', "app\admin\controller\auto\NoteBooks@status");
});

//在线更新
Route::group('update', function () {
    Route::get('index', "app\admin\controller\Update@index");
    Route::get('get_update_history', "app\admin\controller\Update@get_update_history");
    Route::get('get_current_version', "app\admin\controller\Update@get_current_version");
    Route::rule('upload_file', "app\admin\controller\Update@upload_app", 'POST');
    Route::post('start_update', "app\admin\controller\Update@start_update");
    Route::post('cancel_update', "app\admin\controller\Update@cancel_update");
});
